﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Moop.Common.IFaces.Database;

namespace Moop.UI.Converters
{

    public class FolderItem : INotifyPropertyChanged
    {
        public virtual event PropertyChangedEventHandler PropertyChanged;

        public FolderItem()
        {
        }

        private string _name;
        public  string Name
        {
            get { return _name; }
            set
            {
                //ignore if values are equal
                if (value == _name) return;

                _name = value;
                OnPropertyChanged("Name");
            }
        }

        private IEnumerable<IOlapEntity> _items;
        public  IEnumerable<IOlapEntity> Items
        {
            get { return _items; }
            set
            {
                if (value == _items) return;

                _items = value;
                OnPropertyChanged("Items");
            }
        }


        private FolderSubItem _subFolderItems;
        public  FolderSubItem SubFolderItems
        {
            get { return _subFolderItems; }
            set
            {
                if (value == _subFolderItems) return;

                _subFolderItems = value;
                OnPropertyChanged("SubFolderItems");
            }
        }

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }


        public override string ToString()
        {
            return Name;
        }

    }

}
